﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;

namespace EasyDDD.Domain.User
{
    /// <summary>
    /// 用户拥有的权限
    /// </summary>
    public class ApplicationUserClaim
    {
        [JsonConstructor]
        public ApplicationUserClaim() { }

        /// <summary>
        /// Gets or sets the primary key of the user associated with this claim.
        /// </summary>
        [Key]
        [ForeignKey(nameof(ApplicationUser))]
        public virtual Guid UserId { get; set; } = default!;
        public virtual ApplicationUser ApplicationUser { get; set; } = default!;


        /// <summary>
        /// Gets or sets the claim type for this claim.
        /// </summary>
        [StringLength(128)]
        public virtual string ClaimType { get; set; } = string.Empty;

        /// <summary>
        /// Gets or sets the claim value for this claim.
        /// </summary>
        [StringLength(128)]
        public virtual string ClaimValue { get; set; } = string.Empty;
    }
}
